<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .parent{
            display: flex;

            /*水平居中*/
            justify-content: center;


            /*在交叉轴上的对齐方式,交叉轴默认从上到下*/
            /*从交叉轴开始的位置对齐，默认值*/
           /* align-items:flex-start;
            /*交叉轴末尾的位置对齐*/
            /*align-items:flex-end;
            /*交叉轴居中对齐，垂直居中*/
            align-items:center;

            /*如果子元素不设置高度的时候，元素会填充满交叉轴，默认值*/
           /* align-items:stretch;*/
            width:800px;
            height:800px;
            background-color: #ff8500;
        }
        .item{
            width:100px;
            height:100px;
            background-color: saddlebrown;
        }
    </style>
</head>
<body>
<div class="parent">
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>

</div>
</body>
</html>